aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/(profile)/+layout.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/[username]/(profile)/+layout.server.ts')
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.server.ts25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.ts b/src/routes/(app)/[username]/(profile)/+layout.server.ts
index 14580694..bf499fb1 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.server.ts
+++ b/src/routes/(app)/[username]/(profile)/+layout.server.ts
@@ -5,25 +5,10 @@ export async function load({ depends, parent }) {
let { subject, user } = await parent();
- subject.follows = [];
- subject.followers = [];
+ let count = get(`/${subject.pubkey}/count`).catch(() => 0);
+ let follows = get(`/${subject.pubkey}/follows`).catch(() => []);
+ let followers = get(`/${subject.pubkey}/followers`).catch(() => []);
+ let followList = get(`/${user.pubkey}/follows?tagsonly=true`).catch(() => []);
- try {
- subject.follows = await get(`/${subject.pubkey}/follows`);
- } catch (e) {
- console.log("problem fetching follows", e);
- }
-
- try {
- subject.followers = await get(`/${subject.pubkey}/followers`);
- } catch (e) {
- console.log("problem fetching followers", e);
- }
-
- // subject.followers = [];
- if (user) {
- user.follows = await get(`/${user.pubkey}/follows?tagsonly=true`);
- }
-
- return { subject, user };
+ return { count, follows, followers, followList };
}